package com.longcai.service.impl.dict;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.longcai.entity.sys.ClyjDict;
import com.longcai.mapper.dict.ClyjDictMapper;
import com.longcai.service.dict.ClyjDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 数据字典表 服务实现类
 * </p>
 *
 * @author kh
 * @since 2019-04-20
 */
@Service
public class ClyjDictServiceImpl extends ServiceImpl<ClyjDictMapper, ClyjDict> implements ClyjDictService {

    @Autowired
    private ClyjDictMapper clyjDictMapper;

    /**
     * 根据TypeCode获取字典值
     **/
    @Override
    public ClyjDict gerByTypeCode(String typeCode) {
        QueryWrapper<ClyjDict> queryWrapper = new QueryWrapper<ClyjDict>();
        queryWrapper.eq("attcode", typeCode);
        ClyjDict clyjDict = clyjDictMapper.selectOne(queryWrapper);
        return clyjDict;
    }

}
